<template>
  <div>
      <div>
            <label>用 户 名:</label>
            <Input  style="width: 200px" v-model="username" />
      </div>
            <div>
            <label>手 机 号:</label>
            <Input   style="width: 200px" v-model="phone" />
      </div>
            <div>
            <label>邮　　箱:</label>
            <Input  style="width: 200px" v-model="email" />
      </div>
      <div>
          <label>密　　码:</label>
          <Input  type="password" style="width: 200px" v-model="password"/>
      </div>
            <div>
          <label>重复密码:</label>
          <Input  type="password" style="width: 200px" v-model="password1"/>
      </div>
      <div>
          <Button type="primary" style="width: 230px" v-on:click="register">确认</Button>
      </div>
  </div>
</template>

<script>
import service from '@/service/index'
    export default{
        name:'register',
        data:()=>{
            return{
            username: '',
            password: '',
            email: '',
            phone: '',
            password1: ''
            }
        },
        methods:{
            register(){
                console.log(this.username,this.password)
                service.post('/v1/register',{
                    body: JSON.stringify({
                        username:this.username,
                        password:this.password,
                        email:this.email,
                        phone:this.phone,
                        password1:this.password 
                    })
                })
                .then((res)=>{
                    console.log(res)
                   '../home/home.vue'
                })
            }
        }
    }
</script>

<style lang="scss" scoped>

</style>